<%@ include file="user_sidebar.jsp" %>
<%@ include file="user_pagehead.jsp" %>
<%@ page language="java" import="se.hh.lab.domain.*" import="java.util.*"   %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <base href="<%=basePath%>">
  </head>
  <body>
   <%  
 
   	 String userID=(String)request.getAttribute("userID");
     int intPage=(Integer)request.getAttribute("intPage");
     @SuppressWarnings("unchecked")
   	 ArrayList<Record> list=(ArrayList<Record>)session.getAttribute("list");
 	 if(userID==null || list==null)
 	 {
 		 response.sendRedirect("user_main.jsp");
 		 return;
 	 }
 	int row=list.size();
    int pageadd=intPage+1;
    int pagesub=intPage-1;
 	
 	
 %>
  
  
  <div id="body-wrapper">
  <div id="main-content">
    <div class="clear"></div>
    <div class="content-box">

      <div class="content-box-header">
        <h3>Content box</h3>
        <ul class="content-box-tabs">
          <li><a href="#tab1" class="default-tab">Table</a></li> </ul>
        <div class="clear"></div>
      </div>
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">
      
          <table>
            <thead>
              <tr>
                <th>User ID</th>
                <th>Barcode</th>
                <th>Borrow Date</th>              
                <th>Return Date</th>
                <th>Real Return Date</th>
              </tr>
            </thead>
            <tfoot>
              <tr>
                <td colspan="6">
                  <div class="pagination"> 
                   <a href="UserBorrowed?page=<%=pagesub%>&userID=<%=userID %>">&laquo; Previous</a>
                   <a href="UserBorrowed?page=<%=pageadd%>&userID=<%=userID %>">Next &raquo;</a>

                     </div>
                  <!-- End .pagination -->
                  
                  <div class="clear"></div>
                  
                </td>
              </tr>
            </tfoot>
            <tbody>
             
              <%for(int i=0;i<row;i++)
              {
            	  %>
              <tr>
                <td><%=list.get(i).getUserID()%></td>
                <td><%=list.get(i).getBarcode()%></td>
                <td><%=list.get(i).getBorrowdate()%></td>
                <td><%=list.get(i).getSbackdate()%></td>
                <td><%=list.get(i).getBackdate()%></td>
                <td>
             </tr>
              <%} %>
            </tbody>
          </table>
        </div>
        <!-- End #tab1 -->   
      </div>
      <!-- End .content-box-content -->    
    </div>
    
      </div>
  <!-- End #main-content -->
</div>
  </body>
</html>
